<ion-header>
    <ion-navbar no-border-bottom>
        <ion-title>写邮件</ion-title>
        <ion-buttons end>
            <button ion-button (click)="editEmail('send')" *ngIf="!isForward">发送</button>
            <button ion-button (click)="editEmail('forward')" *ngIf="isForward">发送</button>
        </ion-buttons>
    </ion-navbar>
</ion-header>
<ion-content class='email-send'>
    <ion-list class='gfoa-list'>
        <ion-item>
            <ion-row>
                <ion-col width-25 class='title'>发件人:</ion-col>
                <ion-col class='substance'>{{name}}</ion-col>
            </ion-row>
        </ion-item>
        <ion-item>
            <ion-row>
                <ion-col width-25 class='title'>收件人:</ion-col>
                <ion-col class='substance'>
                    <div class="selected-user-list-item" *ngFor="let item of recieveList">{{!item.empid?item.full_orgname:(item.full_orgname ? item.full_orgname + "/" + item.name : item.name)}}
                    </div>
                </ion-col>
                <ion-col width-20 class="operate">
                    <button ion-button small (click)="chooseUesr('recieve')">选择</button>
                </ion-col>
            </ion-row>
        </ion-item>
        <ion-item>
            <ion-row>
                <ion-col width-25 class='title'>抄送:</ion-col>
                <ion-col class='substance'>
                    <div class="selected-user-list-item" *ngFor="let item of otherList">
                      {{!item.empid?item.full_orgname:(item.full_orgname ? item.full_orgname + "/" + item.name : item.name)}}
                    </div>
                </ion-col>
                <ion-col width-20 class="operate">
                    <button ion-button small (click)="chooseUesr('other')">选择</button>
                </ion-col>
            </ion-row>
        </ion-item>
        <ion-item>
            <ion-row>
                <ion-col width-25 class='title'>密送:</ion-col>
                <ion-col class='substance'>
                    <div class="selected-user-list-item" *ngFor="let item of secretList">
                      {{!item.empid?item.full_orgname:(item.full_orgname ? item.full_orgname + "/" + item.name : item.name)}}
                    </div>
                </ion-col>
                <ion-col width-20 class="operate">
                    <button ion-button small (click)="chooseUesr('secret')">选择</button>
                </ion-col>
            </ion-row>
        </ion-item>
        <ion-item>
            <ion-row>
                <ion-col width-25 class='title'>主题:</ion-col>
                <ion-col class='substance'>
                    <input type="text" placeholder="请输入主题" name="" [(ngModel)]="email.bostitle">
                </ion-col>
            </ion-row>
        </ion-item>
        <ion-item>
            <ion-label>重要性:</ion-label>
            <ion-select [(ngModel)]="email.urgency" okText="确认" cancelText="取消">
                <ion-option value="1">重要</ion-option>
                <ion-option value="2">一般</ion-option>
                <!-- <ion-option value="3">缓慢</ion-option> -->
            </ion-select>
        </ion-item>
        <ion-item>
            <ion-label>回执:</ion-label>
            <ion-select [(ngModel)]="email.isreceipt" okText="确认" cancelText="取消">
                <ion-option value="1">是</ion-option>
                <ion-option value="0">否</ion-option>
            </ion-select>
        </ion-item>
    </ion-list>
    <ion-list class='gfoa-list'>
        <ion-item-divider color="light" id="dividerEmailContent">邮件正文</ion-item-divider>
        <ion-item class='text-content'>
            <div id="email-send-input-content" contenteditable="true" [innerHTML]="inputContent"
            (focus)="focusEmailContent()">
            </div>
             <!--<textarea [(ngModel)]="inputContent" placeholder="请输入正文"></textarea> -->
        </ion-item>
    </ion-list>
    <ion-list class='gfoa-list' *ngIf="email.attach">
        <ion-item-divider color="light">附件</ion-item-divider>
        <ion-item class='text-content attach-item' *ngFor="let attach of display_attach.split(';');let i=index;" (click)="openFile(attach.split(',')[0],attach.split(',')[1])">
            {{i+1+"："+attach.split(',')[1]}}
        </ion-item>
    </ion-list>
    <ion-row style="margin-bottom: 20px;">
        <ion-col *ngIf="!isForward">
            <button ion-button icon-left block color="light" (click)="editEmail('send')">
                <ion-icon name="send"></ion-icon>
                立刻发送
            </button>
        </ion-col>

        <ion-col *ngIf="isForward">
            <button ion-button icon-left block color="light" (click)="editEmail('forward')">
                <ion-icon name="send"></ion-icon>
                立刻发送
            </button>
        </ion-col>
        <ion-col>
            <button ion-button icon-left block color="light" (click)="editEmail('draft')">
                <ion-icon name="document"></ion-icon>
                保存草稿
            </button>
        </ion-col>
    </ion-row>
</ion-content>
